-
Notifications
You must be signed in to change notification settings - Fork 19
Add error response parsing for restXml #922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d30c5e3 to
78d0aca
Compare
...client-http/src/main/java/software/amazon/smithy/java/client/http/HttpErrorDeserializer.java
Outdated
Show resolved
Hide resolved
| * @param source Response payload source | ||
| * @return String value of the Code element if found | ||
| */ | ||
| public String parseCodeName(ByteBuffer source) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems out of place on XmlCodec. Maybe move to XmlDeserializer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XmlDeserializer is package private and we cannot access it if we put it to XmlDeserializer. I think XmlCodec is the only public class under this package, so I put the method here.
Current implementation for restXml could not parse the error response because the HttpErrorDeserializer is converting the response to document which is not supported in restXml. This PR adds a fix for this to pass protocol tests "InvalidGreetingError" and "ComplexError".
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.